<?php 
include('../Connections/KRAPPERCON.php');
include('../Connections/Accesos.php');
?>
<div>
<input type="button" value="Buscar" onClick="verArticulo()"/>&nbsp;&nbsp;&nbsp;
<input name="rbmat" type="radio" id="rb_mt1" value="rb_mt1" checked="checked" />
&nbsp;Codigos KRAPPER&nbsp;&nbsp;
<!-- <input type="radio" id="rb_mt2" name="rbmat" value="rb_mt1" />&nbsp;Todos&nbsp;&nbsp; -->
</div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>Articulo :</td>
    <td>
      <input type="text" name="t_cm_codart" onKeyPress="enterArticuloCM(event)" id="t_cm_codart">  </td>
    <td>Almacen :</td>
    <td>
      <select name="cbo_mc_alm" id="cbo_mc_alm">
      
      <?php 
	  $combo = '';
	  include('../Query_Min/getAlmacenes.php'); 
	  echo $combo;
	  ?>
      </select>   </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td colspan="4">
    <div id="d_resmat"></div>
    </td>
  </tr>
</table>

<script type="text/javascript">
function verArticulo(){
	var cod = GEBI('t_cm_codart').value;
	if ($.trim(cod) == ''){
	showError('Debe ingresar el Codigo de Articulo');
	return;
	}
	
	var opc = 0;
	if (GEBI('rb_mt1').checked){
	opc = 1;
	}
	if (GEBI('rb_mt2').checked){
	opc = 2;
	} 
	$('#d_resmat').loadx('Consultas/Opers/queryArticulo.php',{ oper : 'view', opcion: opc, t_cm_codart : cod , cbo_cm_alm : GEBI('cbo_mc_alm').value });
}

function enterArticuloCM(e){
	if (e.keyCode == 13){
		verArticulo();
	}
}


</script>